package com.briup.ch03;

public class Test01 {
    public static void main(String[] args) {
        System.out.println(5/2);//int
        System.out.println(5f/2);//float
        System.out.println(5/2.0);//double
        System.out.println(5%2);//int
        System.out.println(5%2.0);//double
        System.out.println(5%2f);//float
        int n = 13 % 5;
        System.out.println("n: " + n); // ?
        n = -13 % 5;
        //-13源码：10000000 00000000 00000000 00001101
        //反码：   11111111 11111111 11111111 11110010
        //补码：   11111111 11111111 11111111 11110011
        System.out.println("n: " + n); // ?
        n = 13 % -5;
        System.out.println("n: " + n); // ?
        n = -13 % -5;
        System.out.println("n: " + n); // ?

        System.out.println("hello"+'a'+1);
        System.out.println('a'+1+"hello");
        System.out.println(1+'a'+"hello");
        System.out.println("5+5="+5+5);
        System.out.println(5+5+"=5+5");
        //快速将其他类型转换为字符串
        System.out.println(null+"");
        System.out.println(false+"");
        int x = 4;
        int y = (x--) + (--x) + (x * 10);
        System.out.println("x: " + x); // x: ?
        System.out.println("y: " + y); // y: ?
        byte b = 126;
        b++;
        b =(byte)(b + 1);//-128
        short s = 10;
        //s = s + 5; //error
        s += 5; // s = (short)(s+5);
        System.out.println("s: " + s);
        s+=2.0;
        System.out.println(s);
    }
}
